package demo3;



class Util{
    public static<E> void swap(E[]arr ,int i,int j){
        E tmp=arr[i];
        arr[i]=arr[j];
        arr[j]=tmp;
    }
}
public class Test {
    public static void main(String[] args) {
        Integer[] arr={1,2,3,4,5,6};
        Util.swap(arr,0,1);
        for(int x:arr){
            System.out.println(x);
        }
        Util.<Integer>swap(arr,0,1);
        for(int x:arr){
            System.out.println(x);
        }
    }
}
